package com.cloud.service;

import com.cloud.config.FeignConfigToken;
import com.cloud.pojo.ReagentResult;
import com.cloud.pojo.ReagentUser;
import com.cloud.pojo.SamplingInfo;
import com.cloud.service.impl.DataTranFeignServiceImpl;
import com.cloud.tools.CommonResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;
import java.util.Map;

/**
 * @Author: Tangtao
 * @Date: 2022/5/5 9:22
 * @Description: User management service invocation based on OpenFeign
 * @ClassName: DataTranFeignService
 */

@Component
@FeignClient(value = "data-tranmission-service", fallback = DataTranFeignServiceImpl.class,
        configuration = FeignConfigToken.class)
public interface DataTranFeignService {

    /* 提交试剂瓶信息 及对应 志愿者Id */
    @PostMapping(value = "/reagent/Info")
    public CommonResult saveReagentInfo(@RequestBody SamplingInfo samplingInfo);

    /* 提交试剂瓶对应的核酸检测用户信息 */
    @PostMapping(value = "/reagent/UserInfo")
    public CommonResult saveReagentUserInfo(@RequestBody List<ReagentUser> list);

    /* 用户对于检测结果的查询 */
    @GetMapping(value = "/result/check")
    public CommonResult checkTestResult();

    /* 医护人员进行检测结果的单个上传 */
    @PostMapping(value = "/result/doctorSend/one")
    public CommonResult saveTestResultOnce(@RequestBody ReagentResult reagentResult);

    /* 医护人员进行检测结果的批量上传 */
    @PostMapping(value = "/result/doctorSend/batch")
    public CommonResult saveTestResultBatch(@RequestBody List<ReagentResult>  reagentResultList);

    /* 管理员进行检测结果的修改 */
    @PostMapping(value = "/result/managerUpdate")
    public CommonResult resultManage(@RequestBody ReagentResult reagentResult);

    @GetMapping(value = "/region/allInfo")
    public CommonResult getRegion();

    @PostMapping(value = "/reagent/ManagerGetResult")
    public CommonResult getResultFromUserId(@RequestBody Map<String,String> map);

    @GetMapping(value = "/reagent/Allresult")
    public CommonResult getAllResult();

    @PostMapping(value = "/result/delete")
    public CommonResult resultDelete(@RequestBody Map<String,String> map);

}